#include <stdio.h>
#include <string.h>
#include <pari/pari.h>
#include "cyassl/ctaocrypt/sha.h"

int main(void)
{
	int M = 3;
	int sample[9] = {9, -36, 30, -36, 192, -180, 30, -180, 180};
	char hexstring[] = "deadbeef1";
	char array[]= "13d8f287683487383489394a4ffbc3AAAAA";
	printf("%d\n",sizeof(sample)/sizeof(sample[0]));
	printf("%d\n",sizeof(array)/sizeof(array[0]));
	printf("%d\n",sizeof(hexstring)/sizeof(hexstring[0]));
	int r,s,count=0;
/*	char mat[M][M];
	for(r=0;r<M;++r)
	{
		for(s=0;s<M;++s)
		{
			mat[r][s]=hexstring[count];
			printf("mat[%d][%d] = %c\n",r,s,mat[r][s]);
			count++;
		}
	}
*/
	int mat[M][M];
	for(r=0;r<M;++r)
		{
			for(s=0;s<M;++s)
			{
				mat[r][s]=sample[count];
				printf("mat[%d][%d] = %d\n",r,s,mat[r][s]);
				count++;
			}
		}

	int var = 0;
	pari_init(1000000,2);
	GEN p1;
	p1 = cgetg(M+1, t_MAT);

	for (var = 0; var < M; ++var) {

		gel(p1, var) = cgetg(M+1, t_COL);
		gel(p1, var) = cgetg(M+1, t_COL);
		gel(p1, var) = cgetg(M+1, t_COL);
	}

	for(r=0;r<M;++r)
	{
		for(s=0;s<M;++s)
		{
			gcoeff(p1, r+1, s+1) = stoi(mat[r][s]);
		}
	}

	pari_printf("%Ps\n", mathnf0(p1, 0));
	pari_close();
	return 0;
}
